<template>
    <div class="tian">
        <div class="top">
            <div class="box">
                <Tickets />
            </div>
            <span style="margin-left: 10px;">数据列表</span>
        </div>
        <div class="bottom">
            <el-row class="mb-4">
                <el-button >添加</el-button>
            </el-row>
        </div>
    </div>
    <!-- 表格 -->
    <div class="table-container">
        <el-table :data="Flash" border style="width: 100%" table-layout="auto">
            <el-table-column prop="id" label="编号" />
            <el-table-column prop="subTitle" label="商品名称" />
            <el-table-column prop="productId" label="货号" />
            <el-table-column prop="startTime" label="商品价格">

            </el-table-column>
            <el-table-column prop="NO." label="剩余数量" />
            <el-table-column prop="flashPromotionPrice" label="秒杀价格">
                    
            </el-table-column>
            <el-table-column prop="flashPromotionCount" label="秒杀数量"></el-table-column>
            <el-table-column prop="flashPromotionLimit" label="限购数量"></el-table-column>
            <el-table-column prop="sort" label="排序"></el-table-column>
            <el-table-column label="操作" width="120">
                <template #default="{ }">
                    <el-button link type="primary" size="small">编辑</el-button>
                    <el-button link type="primary" size="small">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>

</template>

<script setup lang="ts">

import { ref } from 'vue';
import * as http from '@/request/http'
import {useRoute}from 'vue-router'
let idn = useRoute()
let idB = idn.query.flashPromotionId
let idX = idn.query.flashPromotionSessionId
const Flash =ref<RelationList[]>([])

const falseBox = () =>{
    http.Relation.RelationList({
        flashPromotionId:idB,
        flashPromotionSessionId:idX
    }).then(res => {
        console.log(res);
        Flash.value =res.data.list as any
    })
}
falseBox()
console.log(idn);


</script>

<style scoped>
.top {
    display: flex;
}

.box {
    width: 15px;
    height: 15px;

}

.tian {
    display: flex;
    justify-content: space-between;

    border: 1px solid gainsboro;
    height: 50px;
    line-height: 50px;
    margin: 20px;
    border-radius: 10px;
    padding: 10px;
}

.bottom {
    margin-top: 10px;
}

.fen {
    float: right;
    margin-top: 10px;
    margin-right: 20px;
}
</style>